<?php





// region 公共接口
//上传文件公共接口
Route::post('/upload', 'Common\CommonController@uploadFile');
Route::post('/upload-many', 'Common\CommonController@uploadFileMany');
Route::get('/get-area', 'Common\CommonController@getParentArea');
Route::post('/send-sms-code','Common\CommonController@sendSmsCode');
Route::post('/validate-sms-code','Common\CommonController@validateSmsCode');
Route::post('/send-sms-msg','Common\CommonController@sendSmsMsg');
Route::get('/products/vip', 'Front\VipController@product');
Route::get('/city/{id}', 'Common\CommonController@getCity');
Route::post('/upload-flow','Common\CommonController@uploadFileFlow');
// endregion

Route::get('test', function (){
    return \App\Model\WeChat::sendWeChatMsg('', 'onrTMwCTokTrzAM1CCnRoVheyfow');
});

Route::post('/test-media','Common\TestController@uploadMedia');

Route::get('/places', 'Common\CommonController@getPlaces');


Route::get('refresh', function(\Illuminate\Http\Request $request){
    $phone = $request->input('phone');
    $code = $request->input('code');
    DB::table('sms_validate')->where('mobile_phone',$phone)->where('msg_code', $code)->update(['dead_line'=> date('Y-m-d H:i:s', strtotime('+1 hours')), 'is_valided'=>0]);
    return response()->json(['code'=>$code]);
});

Route::get("/test-spread", "Common\TestController@testSpread");
Route::get("/test-img", "Common\TestController@testImg");
Route::post ('/simulate_login', 'Common\TestController@simulate'); // 模拟登陆